package org.common.utils.rpc.generator.handler.methodbody;
import org.common.utils.rpc.generator.entity.GeneratorInfo;

/**
 * future返回值，方法体处理
 * @author zhouzhibing
 * @date 2025/11/15 18:42
 */
public class FutureHandler extends AbstractHandler {

    public FutureHandler() {
        super(ReturnType.COMPLETABLE_FUTURE);
    }

    @Override
    public String handler(GeneratorInfo generatorInfo) {
        return """
                %s
                return rpcSenders.sendFuture(request);
                """.formatted(getRequest(generatorInfo));
    }
}
